using ApiText.Api.Db;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Linq;
using System.Threading.Tasks;

namespace ApiText.Api.Models
{
    public static class SeedData
    {
        public static void Seed(this ModelBuilder modelBuilder)
        {  
            //初始化种子数据
            modelBuilder.Entity<Users>().HasData(
                new Users
                {
                    Id=1,
                    Username = "三山三水",
                    Password = "123",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = DateTime.Now,
                    UpdatedTime = DateTime.Now,
                    DisplayOrder = 0,
                    Remarks="种子数据"
                }
            );
        }
    }
}